<?php
	
	session_start(); // start session cookies
	require("Login.class.php"); // pull in file
	$login = new Login; // create object login
	
	$login->authorize(); // make user login
	
	//This will carry cookie over from admin.php
	
?>
<!--
	=================================================================================================
	Copyright (c) 2012 Athena Health. 
	This software is the proprietary information of Athena Health
	All Right Reserved.
	Repository path:    $HeadURL: http://athena-call-routing.googlecode.com/svn/trunk/admin/ola_admin.php $
	Last committed:     $Revision: 45 $
	Last changed by:    $Author: davidjmorin@gmail.com $
	Last changed date:    $Date: 2012-07-02 21:10:12 -0400 (Mon, 02 Jul 2012) $
	ID:            $Id: index.php 45 2012-07-03 01:10:12Z davidjmorin@gmail.com $
	=================================================================================================
-->





<?php
	
	define("HOST", "localhost");
	
	$id=$_GET['name'];
	$tm=$_GET['team'];
	$hr=$_GET['hours'];
	$bl=$_GET['block'];
	$sp = $_GET['spec_area'];
	$wx = $_GET['wx'];
	$i_d = $_GET['i_d'];
	
	
	
?>
<link rel="stylesheet" type="text/css" href="admin.css">
<div>
	Update OLA Information
	
	
	<div class="link">
		<a href="index.php">Admin Home</a> : <a href="../index.php">User Home</a> : <a href="ola_admin.php">Update OLA</a>
	</div>
	
</div>
<hr>

<table>
	<tr><td valign="top"><br /><br />
	<img src="http://a0.twimg.com/profile_images/1138695863/twitter-icon.png" width="100px"></td>
	<td>	
		<b><? //echo $_GET['id']; ?></b>
		<form method="post" action="ola_update.php">
			<table>         <tr><br /></tr>
				<tr><td>ID:  </td><td> <input type="hidden" name="i_d" id="i_d" value="<? echo $i_d; ?>"><b> <? echo $i_d; ?></td></tr>
					<tr><td>Name:  </td><td> <input type="hidden" name="name" id="name" value="<? echo $id; ?>"><b> <? echo $id; ?></td></tr>
						<tr><td> Block?: </td><td><input type="text" name="block" id="block" value="<?php echo $_GET['block']; ?>"><br></td></tr>
						<tr><td> Hours:</td><td> <input type="text" name="hours" id="hours" value="<?php echo $hr; ?>"><br></td></tr>
						<tr><td> Webex?: </td><td> <input type="text" name="webex" id="webex" value="<?php echo $wx; ?>"> <br></td></tr>
						<tr><td> Specialty/Area?: </td><td> <input type="text" name="spec_area" id="spec_area" value="<?php echo $_GET['sp']; ?>"> <br></td></tr>
						<tr><td> Team: </td><td> <input type="text" name="team" id="team" value="<?php echo $tm; ?>"> <br></td></tr>
						
						
						<tr><td> </td><td align="left"> <input type="submit" name="submit" value="Submit Data"></td></tr>
					</table>
				</form>
			</td></tr>
	</table>		<br />
	<a href="index.php">Add Keyword</a> | <a href="../admin">Back to search form</a> | 
	
	<?php echo $_GET['bl']; ?>
	
	<?php 
		
		echo $tm;
		echo $wx;
		echo $hours;
		echo $bl;
		
	?> 
	<?php
		
		define("HOST", "localhost");
		
		// Database user
		define("DBUSER", "root");
		
		// Database password
		define("PASS", "123456");
		
		// Database name
		define("DB", "bbpinpal_article");
		
		############## Make the mysql connection ###########
		
		$conn = mysql_connect(HOST, DBUSER, PASS) or  die('Could not connect !<br />Please contact the site\'s administrator.');
		
		$db = mysql_select_db(DB) or  die('Could not connect to database !<br />Please contact the site\'s administrator.');
		
		
		//$query = mysql_query(" SELECT * FROM athena WHERE keyword='".$_POST['value']."' ");
		$query = mysql_query("SELECT * FROM ola ORDER BY block");
		
		echo "<table border='.5' color='#fff' width='600'>
		<tr>
		<th bgcolor='#42520e' style='font-size:18px; color:#fff;'>ID</th>
		<th bgcolor='#42520e' style='font-size:18px; color:#fff;'>Name</th>
		<th bgcolor='#42520e'style='font-size:18px; color:#fff;'>block</th>
		<th bgcolor='#42520e'style='font-size:18px; color:#fff;'>WebEx?</th>
		<th bgcolor='#42520e'style='font-size:18px; color:#fff;'>Hours</th>
		<th bgcolor='#42520e'style='font-size:18px; color:#fff;'>Team</th>
		<th bgcolor='#42520e'style='font-size:18px; color:#fff;'>Reason</th>
		
		</tr>";
		
		while ($data = mysql_fetch_array($query)) {
			
			echo '
			<tr style="background-color:#576c11;">
			<td style="font-size:18px; color:#f0cb01;">'.$data["id"].'</td>
			<td style="font-size:18px; color:#f0cb01;">'.$data["name"].'</td>
			<td style="font-size:18px;color:#f0cb01;">'.$data["block"].'</td>
			<td style="font-size:18px;color:#f0cb01;">'.$data["webex"].'</td>
			<td style="font-size:18px;color:#f0cb01;">'.$data["hours"].'</td>
			<td style="font-size:18px;color:#f0cb01;">'.$data["team"].'</td>
			<td style="font-size:18px;color:#f0cb01;">'.$data["spec_area"].'</td>
			<td align="center" bgcolor="#006600"><a href="delete.php?id='.$data["name"].' ">Delete</a></td>
			<td align="center" bgcolor="#006600">
			<a href="ola_admin.php?name='.$data["name"].'&wx='.$data["webex"].'&block='.$data['block'].'&team='.$data['team'] .'&hours='.$data['hours'] .'&sp='.$data['spec_area'].'&i_d='.$data['id'].'">update</a></td>
			
			
			
			</tr>';
			
		}
		
		echo '</table>';
		
	?>
	
	
	
	<a href="index.php?action=clear_login">logout</a>
	</body>
